Skip to content

fix: correct into_iter() example to compile properly#2001

Merged
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1904-into-iter-compile-error
Apr 1, 2026
Merged

fix: correct into_iter() example to compile properly#2001
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1904-into-iter-compile-error

Conversation

@Abhinav-ranish
Copy link
Copy Markdown
Contributor

Fixes #1904

The into_iter() example failed to compile because names was used after being moved. Commented out the offending println! with an explanation that names has been consumed and can no longer be used.

The into_iter() example previously used `println!("names: {:?}", names)`
after the collection was consumed, causing a compilation error. Commented
out the offending line with an explanation and removed the `ignore` flag
so the example is now compilable and runnable.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

r? @marioidival

rustbot has assigned @marioidival.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @marioidival

@marioidival marioidival merged commit b31e3b8 into rust-lang:master Apr 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

src/flow_control/for.md into_iter() example invalid

3 participants